package com.nut.course.api.biz;

import com.nut.course.common.Result;
import com.nut.course.entity.Department;
import com.nut.course.service.DepartmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @RequestMapping(value = "/list")
    public Result<List<Department>> list() {
        return departmentService.list();
    }

    @GetMapping(value = "/syncData")
    public Result syncData() {
        return departmentService.syncData();
    }

}
